import React, { Component } from 'react'
import { HashRouter as Router, Route} from "react-router-dom"
import Bar from "./components/bar/index"
import Home from "./components/home/index"
import Cart from "./components/cart/index"
import My from "./components/my/index"
import Product from "./components/product/index"
import SearchCon from "./components/searchcon/index"
import GoodList from "./components/goodlist/index"
import Goodetailed from "./components/goodetailed/index"

export default class RouterConfig extends Component {
    render() {
        return (
            <Router>
                <Route path="/" exact  render={() => <Bar><Home></Home></Bar>}/>
                <Route path="/cart" exact  render={() => <Bar><Cart></Cart></Bar>}/>
                <Route path="/my" exact  render={() => <Bar><My></My></Bar>}/>
                <Route path="/product" exact  render={() => <Bar><Product></Product></Bar>}/>
                {/* 配置搜索页面 */}
                <Route path="/searchcon" exact component={SearchCon} />
                {/* 配置轮播图详细页 */}
                <Route path="/goodetailed/:id" render={ (porps) => <Goodetailed {...porps}></Goodetailed>}/>
                {/* 配置商品详情页 */}
                <Route path="/goodlist/:query" render={ (porps) => <GoodList {...porps}></GoodList>}/>
            </Router>
        )
    }
}
